
//-------5.6.2 Number 类型--------------------
var numberObject = new Number(10);
var numberValue = 10;

console.log(typeof numberObject);
console.log(typeof numberValue);
console.log(numberObject instanceof Number);
console.log(numberValue instanceof Number);


//------5.6.3 String 类型-------------------

console.log('------5.6.3 String 类型 -----------');
(function(){
	var stringObject = new String("hello world");
	console.log(stringObject.length);
	
	// 字符方法
	console.log(stringObject.charAt(1));
	console.log(stringObject.charCodeAt(1));
	console.log(stringObject[1]);
}());


// 字符串操作方法
(function(){
	var stringValue = "hello ";
	var result = stringValue.concat("world");
	console.log(result);
	console.log(stringValue);

	var result2 = stringValue.concat("world"," !");
	console.log(result2);
	console.log(stringValue);
}());

(function(){
	var stringValue = "hello world";

	console.log(stringValue.slice(3));
	console.log(stringValue.substring(3));
	console.log(stringValue.substr(3));
	console.log(stringValue.slice(3,7));
	console.log(stringValue.substring(3,7));
	console.log(stringValue.substr(3,7));


	console.log(stringValue.slice(-3));
	console.log(stringValue.substring(-3));
	console.log(stringValue.substr(-3));
	console.log(stringValue.slice(3,-4));
	console.log(stringValue.substring(3,-4));
	console.log(stringValue.substr(3,-4));
}());


//------5.7.2 Math对象 -----------------------
(function(){
	var values = [1,2,3,4,5,6,7,8];
	var max = Math.max.apply(Math,values);
	console.log(max);
}());

